#ifndef tafang_DevMacros_h
#define tafang_DevMacros_h

#include "PreInclude.h"

#define EMPTY_DATA -9999

#define DEV_PROPERTY(varType, varName, funName)\
protected: varType varName;\
public: virtual varType get##funName(void){return varName;}\
public: virtual void set##funName(varType var){varName=var; }\


#define DEV_PROPERTY_VALUE(varType, varName, funName,value)\
protected: varType varName;\
public: virtual varType get##funName(void){return varName;}\
public: virtual void set##funName(varType var=value){varName=var; }\



#define DEV_PROPERTY_READONLY(varType, varName, funName)\
protected: varType varName;\
public: virtual varType get##funName(void){return varName; }\




#define DEV_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName)\
protected: varType varName;\
public: virtual const varType& get##funName(void){return varName; }\


static const float PI=3.1415926f;
static const float  MY_PI = float(180 / PI);



typedef std::map<std::string, std::string>				blStrMap;
typedef std::map<std::string, std::string>::iterator	blStrIter;

template <typename T> inline void SAFE_DEL( T& p )
{
	if( p != NULL )
	{
		delete p;
		p = NULL;
	}
}

template <typename T> inline void SAFE_DEL_ARRAY( T& p )
{
	if( p != NULL )
	{
		delete []p;
		p = NULL;
	}
}

#ifdef WIN32
#include <math.h>
inline double round(double r)
{
    return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5);
}
#endif
 

#endif
